home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / gui / muibuilderv11.lha / muibuilder / mb / c / locale / Small_Example.c < prev    next >
C/C++ Source or Header  |  1994-03-06  |  3KB  |  98 lines

  1. #include <libraries/mui.h>
  2. #include <proto/muimaster.h>
  3. #include <clib/exec_protos.h>
  4. #include <exec/memory.h>
  5.  
  6. #ifndef MAKE_ID
  7. #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  8. #endif
  9.  
  10. #ifdef __DCC
  11. #define __inline
  12. #endif
  13.  
  14. /*    ExTended KeyButton ( or Eric Totel KeyButton :-) )    */
  15. /*    to use with localization features             */
  16.  
  17. static APTR __inline ETKeyButton(char *text)
  18. {
  19.         return (KeyButton(&text[3], text[1]));
  20. }
  21.  
  22. #include "Small_Example.h"
  23. #include "Small_Example_cat.h"
  24.  
  25.  
  26. struct ObjApp * CreateApp( void )
  27. {
  28.     struct ObjApp * Object;
  29.  
  30.     if (!(Object = AllocVec( sizeof( struct ObjApp ), MEMF_PUBLIC|MEMF_CLEAR )))
  31.         return( NULL );
  32.  
  33.  
  34.     Object->App = ApplicationObject,
  35.         MUIA_Application_Author, "Eric Totel",
  36.         MUIA_Application_Base, "SMALL",
  37.         MUIA_Application_Title, "Small_Example",
  38.         MUIA_Application_Version, "$VER : Small 1.0",
  39.         MUIA_Application_Copyright, "(c) 1993 Eric Totel",
  40.         MUIA_Application_Description, GetSmall_ExampleString( MSG_AppDescription ),
  41.         MUIA_HelpFile, "small.guide",
  42.         SubWindow, Object->WI_smallexample = WindowObject,
  43.             MUIA_Window_Title, GetSmall_ExampleString( MSG_WI_smallExample ),
  44.             MUIA_HelpNode, "WI_smallexample",
  45.             MUIA_Window_ID, MAKE_ID( '0','W','I','N' ),
  46.             WindowContents, Object->GROUP_ROOT_0 = GroupObject,
  47.                 Child, Object->GR_lists = GroupObject,
  48.                     GroupFrameT( GetSmall_ExampleString( MSG_GR_lists ) ),
  49.                     MUIA_HelpNode, "GR_lists",
  50.                     MUIA_Group_Horiz, TRUE,
  51.                     Child, Object->LV_label_0 = ListviewObject,
  52.                         MUIA_HelpNode, "LV_label_0",
  53.                         MUIA_Listview_List, DirlistObject,
  54.                             InputListFrame,
  55.                             MUIA_Dirlist_Directory, "progdir:",
  56.                             MUIA_Dirlist_DrawersOnly, FALSE,
  57.                             MUIA_Dirlist_FilesOnly, FALSE,
  58.                             MUIA_Dirlist_FilterDrawers, FALSE,
  59.                             MUIA_Dirlist_MultiSelDirs, FALSE,
  60.                             MUIA_Dirlist_RejectIcons, FALSE,
  61.                             MUIA_Dirlist_SortDirs, MUIV_Dirlist_SortDirs_First,
  62.                             MUIA_Dirlist_SortHighLow, FALSE,
  63.                             MUIA_Dirlist_SortType, 0,
  64.                         End,
  65.                     End,
  66.                     Child, Object->LV_label_1 = ListviewObject,
  67.                         MUIA_HelpNode, "LV_label_1",
  68.                         MUIA_Listview_MultiSelect, MUIV_Listview_MultiSelect_Default,
  69.                         MUIA_Listview_List, VolumelistObject,
  70.                             InputListFrame,
  71.                         End,
  72.                     End,
  73.                 End,
  74.                 Child, Object->GR_grp_1 = GroupObject,
  75.                     MUIA_HelpNode, "GR_grp_1",
  76.                     MUIA_Group_Horiz, TRUE,
  77.                     MUIA_Group_SameWidth, TRUE,
  78.                     Child, Object->BT_ok = ETKeyButton( GetSmall_ExampleString( MSG_BT_ok ) ),
  79.                     Child, Object->BT_cancel = ETKeyButton( GetSmall_ExampleString( MSG_BT_cancel ) ),
  80.                 End,
  81.             End,
  82.         End,
  83.     End;
  84.  
  85.     if (!(Object->App))
  86.     {
  87.         FreeVec(Object);
  88.         Object = NULL;
  89.     }
  90.     return( Object );
  91. }
  92.  
  93. void DisposeApp( struct ObjApp * Object )
  94. {
  95.     MUI_DisposeObject(Object->App);
  96.     FreeVec( Object );
  97. }
  98.